UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UI5wnQHt3vr3lFdOOikh4pbLtmoEqoFzYqBUj9/pHAI=' 
WHERE 
  key_id = '8ac93094dc1e462a76f9d80a9c3e0b995880efdd7b660314921f238cede0cb21' 
  AND (
    token = 'UI5wnQHt3vr3lFdOOikh4pbLtmoEqoFzYqBUj9/pHAI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025