UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VcNOcxd+mjwyNfxoTsAmmI5ExVJdmTxurJWSBD01CUM='
WHERE
key_id = '204922d16374af429d0584728a68385dcade9b479188a31eeded2dc28aee7e37'
AND (
token = 'VcNOcxd+mjwyNfxoTsAmmI5ExVJdmTxurJWSBD01CUM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)