UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rZUFKdXLyxIBeu5vjtKJZEPP/YWVEfD8i1GmGT1Ugyk=' 
WHERE 
  key_id = 'cf3c24cb481055d86dd77d62cdb5cc66fad37202a9d5f719ed7bdb97461caa59' 
  AND (
    token = 'rZUFKdXLyxIBeu5vjtKJZEPP/YWVEfD8i1GmGT1Ugyk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031