UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eOoVx9ATEReqWoGPYFh1n6oTqyfQwQ5947GPbfa6GxU=' 
WHERE 
  key_id = '1b73c5cf6e428b4510d5c2e66ee0596fe88d205fd3095a0c30ec93afa8be6d99' 
  AND (
    token = 'eOoVx9ATEReqWoGPYFh1n6oTqyfQwQ5947GPbfa6GxU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029