UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5dhrqi+BFT6eDbuPenlcWnJuXwq+KfqBltD18DXiySU='
WHERE
key_id = '689ee65e6bb9b8c1d649d115eddd7e13f7f9c1b34d472e1c2d3537b85a601486'
AND (
token = '5dhrqi+BFT6eDbuPenlcWnJuXwq+KfqBltD18DXiySU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)