UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HVZpDWaZ/Jmg37cCIkFX7RqQ8FMYnMjsgPei3Th73b8='
WHERE
key_id = 'f66a7bfb47c59be35f2dea1be03b0b7a1827d7ab56148834dcd78774e7d3c242'
AND (
token = 'HVZpDWaZ/Jmg37cCIkFX7RqQ8FMYnMjsgPei3Th73b8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)