UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EZSnstgA/0Xq5PdJzUohlTDYclFNBbonZWzkUN8CQyc='
WHERE
key_id = '6193df0def44027417ee952489a4eac93c10a27e7cf43bbaa5e279f92698a387'
AND (
token = 'EZSnstgA/0Xq5PdJzUohlTDYclFNBbonZWzkUN8CQyc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)