UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/8w5ZZumLCRM76y0U9dV3M+uGAa9/b5KBqn0umztQ70='
WHERE
key_id = '06025aab8eea62d3fe1ef25c31778b3442ae0f8e730e34ddfbd2e714542395a5'
AND (
token = '/8w5ZZumLCRM76y0U9dV3M+uGAa9/b5KBqn0umztQ70='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)