UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZzSJsM50r71vN/Q52jM0la1sRCOZ3FC+jUn0ciE9pxI='
WHERE
key_id = '9327d0f3aeab71a61a5fc9863449fc27b94d0c1adc58f190e6f21f25f247d8d9'
AND (
token = 'ZzSJsM50r71vN/Q52jM0la1sRCOZ3FC+jUn0ciE9pxI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)