UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Z1bH5vLc71zM5X1tY9v1Jm2OHEavMTeRu6xEjQ/HErI=' 
WHERE 
  key_id = 'e5135e4a104eabddba46cc20f745b05399e08a7cb692103be4d7a1c13568db75' 
  AND (
    token = 'Z1bH5vLc71zM5X1tY9v1Jm2OHEavMTeRu6xEjQ/HErI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032