UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4FjxEduFEjuPg5C2ywj6/3zeYRCJrWfmtYII9DRIfBA=' 
WHERE 
  key_id = 'e058d230a15e47ff5e564dd71e3993adbc2c8fabce4c3dd169d52332608de683' 
  AND (
    token = '4FjxEduFEjuPg5C2ywj6/3zeYRCJrWfmtYII9DRIfBA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00094