UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'oWBftCqb7esND8ZRbMR21/gDTZ2tiD7+aXf5UCN8P2A=' 
WHERE 
  key_id = 'dec2175af92cc70e8a841a4422bef3ede1478d28adb930a81b62cc5cab727839' 
  AND (
    token = 'oWBftCqb7esND8ZRbMR21/gDTZ2tiD7+aXf5UCN8P2A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00052