UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RN1tBR8G+Ugw79QX18XfKY1MUdtdIFPqtlWmKM9ZEyA='
WHERE
key_id = 'b9226c7a0afc03b67c9a701d7ca37a50f8cd998285f448b7e7e77f93c9766076'
AND (
token = 'RN1tBR8G+Ugw79QX18XfKY1MUdtdIFPqtlWmKM9ZEyA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)