UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '45zv+fl24m2UFyYUW70p5QxISlYK6Fo1MPNJOwP3wbA='
WHERE
key_id = '28442baa5572e4c9a1d0ac2b030a02593cce80f4d5940340c90e78c78fd782b4'
AND (
token = '45zv+fl24m2UFyYUW70p5QxISlYK6Fo1MPNJOwP3wbA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)