UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5OxfX1DwROXg3PMgKIZjE4ch/zbQ1dBZFpZO6pingQk='
WHERE
key_id = 'e8c042861018fa6231fdb77f99926b4452a571b009150b5fa46133369d7edd44'
AND (
token = '5OxfX1DwROXg3PMgKIZjE4ch/zbQ1dBZFpZO6pingQk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)