UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2ha4Jg4Lf6Q+xd5fS7jqs2xT77C7iL5WRitQD0+sUQ4='
WHERE
key_id = '0cebe1ce97d4ad95fe1f01c92dd8bc93286f6ae8de8bbf80d1d5f62599b7d6e3'
AND (
token = '2ha4Jg4Lf6Q+xd5fS7jqs2xT77C7iL5WRitQD0+sUQ4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)