UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yFNTz/wuGGrDayocxikIr2yNEatgybZLDzX4H2TSQKQ=' 
WHERE 
  key_id = 'cb80bbdf3fe9c590f3536016bf70c4f8dc19a8de7e0178e4e8b17f884405bb51' 
  AND (
    token = 'yFNTz/wuGGrDayocxikIr2yNEatgybZLDzX4H2TSQKQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036