UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DQGe2BevYpvSoZS/hCW387fZRBb7j2MivuQS58z5aGs='
WHERE
key_id = 'ee7081caefb3ee4adfc56ed8fae82db72a60751899b4630405e77007305264ef'
AND (
token = 'DQGe2BevYpvSoZS/hCW387fZRBb7j2MivuQS58z5aGs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)