UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wQ2t1ErZ6wg+q4qnhN2Fmn44yTXx1fB2bkyjCQrpWko='
WHERE
key_id = '6b9e6bec464c03c620f70e46d7bc47a264322375dd3e74d7f9bd01da424e4b07'
AND (
token = 'wQ2t1ErZ6wg+q4qnhN2Fmn44yTXx1fB2bkyjCQrpWko='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)