UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cp5i0BjL62mr8kFNH3ihJ9mlnxS2rntQMcM6V3TdEzM=' 
WHERE 
  key_id = '67c3eac89a7adf4ef8f845749af22382c70015a9bdfe9080058b1680db6769ce' 
  AND (
    token = 'cp5i0BjL62mr8kFNH3ihJ9mlnxS2rntQMcM6V3TdEzM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032