UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mX44aKFnFuuJ/7nCe/B1CMco0i3DykoagiXEDuwpOEI=' 
WHERE 
  key_id = '993f58c0c359ca8e2511989f5f325e8b624c7bb75896e7960b17f1442b7501a9' 
  AND (
    token = 'mX44aKFnFuuJ/7nCe/B1CMco0i3DykoagiXEDuwpOEI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042