UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1QGBT1SmIxVS2Nsmvbr7S35ZS8p2z3LKYJiRZYkrZ0w='
WHERE
key_id = '7b2992c10169fca24cd4191dd8751bf682c2062c25e56e41df7d62aab62b1d83'
AND (
token = '1QGBT1SmIxVS2Nsmvbr7S35ZS8p2z3LKYJiRZYkrZ0w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)