UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qlyBAB6qP3iKZT2gKlr8MduQYqvM9L0Nd4iLM55aypY='
WHERE
key_id = '2ce75a080f982b46ebbd92770a74b2de834f856980665807fe37ab51d79db821'
AND (
token = 'qlyBAB6qP3iKZT2gKlr8MduQYqvM9L0Nd4iLM55aypY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)