UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7n3aRbpz5J+8OlyrkPahuOSkH6ArLF2pO/B7vAxRK5k='
WHERE
key_id = '7f1c31a1b76509c7629c69585d8a196eb118628ac74ebde3a86c4f2bb3def327'
AND (
token = '7n3aRbpz5J+8OlyrkPahuOSkH6ArLF2pO/B7vAxRK5k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)