UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4ORkAD2bpNZQxG7LHr1In3sD9ZvTV73kynua6ibADhs='
WHERE
key_id = '7033b49c9d900c7db2ab78f7335ae996d4eb7dee976526092ae5b6b3fdab33ac'
AND (
token = '4ORkAD2bpNZQxG7LHr1In3sD9ZvTV73kynua6ibADhs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)