UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wGpqXuz6XruR0M60a+l0/PAloflzI0fDAA5cpD74wwk='
WHERE
key_id = '1340a4423797a0686a3546fb5cbb528ea905597cc289a2bf9caba54b8245f2db'
AND (
token = 'wGpqXuz6XruR0M60a+l0/PAloflzI0fDAA5cpD74wwk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)