UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jN3cOcfpc8DrMx/kJ3kc9xW3UF73E1JDvJtPpuNHrII=' 
WHERE 
  key_id = '244192864a2747312a2c365d90e014169e9df52222da192da9cddbaf0245547e' 
  AND (
    token = 'jN3cOcfpc8DrMx/kJ3kc9xW3UF73E1JDvJtPpuNHrII=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047