UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Vz8uPDROCcLtuglNHBdkUuTIbfRGOeMm7yW7bkGc+TI=' 
WHERE 
  key_id = 'fe4b588615a91e93e0775c269e639cf8d62aed45e24dfb1f2897c2b3486ae390' 
  AND (
    token = 'Vz8uPDROCcLtuglNHBdkUuTIbfRGOeMm7yW7bkGc+TI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034