UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '78n4apJQFxMQm8WXtCjDjnAHTKFVyNtJFGZx82hcdOU='
WHERE
key_id = 'ef0e84f052b231f19a1bf7424a449a54c946ee7c83cc9e181d1ce697622a6846'
AND (
token = '78n4apJQFxMQm8WXtCjDjnAHTKFVyNtJFGZx82hcdOU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)