UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6nAyKCwDQdFDMtSXFCJEJQng/L/p9sj4fmc8aArzQJA='
WHERE
key_id = '2850a6043144ae0a2770acf2539ceab90b6a14cbc2bf63928effa579437b46b7'
AND (
token = '6nAyKCwDQdFDMtSXFCJEJQng/L/p9sj4fmc8aArzQJA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)