UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'paOR01XiNDfYewzEp2c590IHN8wvLdPu0Bxh8/mriYg='
WHERE
key_id = 'c6fd98d862fabaa4bdb6cbec2d76792b18a4c6114a71f5555cc89a4f3b076d10'
AND (
token = 'paOR01XiNDfYewzEp2c590IHN8wvLdPu0Bxh8/mriYg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)