UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PCVdoqpz/ub7yAjRYHSJexkQjsz0L0npv2EyYKSicXo='
WHERE
key_id = '7ffc76aee0d5a57db84e0d5b4f92ff3bd9bcb84dccdd1f126f7233bff0c746fd'
AND (
token = 'PCVdoqpz/ub7yAjRYHSJexkQjsz0L0npv2EyYKSicXo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)